/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 - 2008 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.persistence.dao;

import com.genia.toolbox.basics.exception.technical.TechnicalException;
import com.genia.toolbox.persistence.exception.PersistenceException;

/**
 * a class that contains the basics method for creating, updating, deleting a
 * persistent type of object.
 * 
 * @param <TYPE>
 *          the type of the publicly seen object
 */
public interface SpecificDAO<TYPE>
{
  /**
   * returns a new instance of the object handled by this DAO.
   * 
   * @return a new instance of the object handled by this DAO
   * @throws TechnicalException
   *           if an error occured
   */
  public abstract TYPE newObject()
      throws TechnicalException;



  /**
   * save a not yet persistent object handled by this DAO.
   * 
   * @param object
   *          the object to save
   * @throws PersistenceException
   *           if an error occured
   */
  public abstract void save(TYPE object)
      throws PersistenceException;



  /**
   * update a persistent object handled by this DAO.
   * 
   * @param object
   *          the object to update
   * @throws PersistenceException
   *           if an error occured
   */
  public abstract void update(TYPE object)
      throws PersistenceException;



  /**
   * delete a persistent object handled by this DAO.
   * 
   * @param object
   *          the object to delete
   * @throws PersistenceException
   *           if an error occured
   */
  public abstract void delete(TYPE object)
      throws PersistenceException;
}
